<%@ page import="java.util.List" %>
<%@ page import="java.util.*" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2022/7/13
  Time: 9:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%
    String s1 = "<script>alert('1111');</script>";
    //String s1="<h1 style='font-size:120px;color:red;'>教育改变生活</h1>";
    request.setAttribute("msg", s1);
    request.setAttribute("age", 25);
    List<Integer> datas= Arrays.asList(1,2,4,6,7,72,67,89,100,105,210);
    pageContext.setAttribute("list",datas);
    Map<String,String> m=new HashMap<>();
    m.put("dog","狗");
    m.put("Cat","猫");
    m.put("frog","青蛙");
    m.put("penguin","企鹅");
    m.put("tiger","老虎");
    request.setAttribute("m",m);
    request.setAttribute("today",new Date());
%>
${msg}
<hr/>
<c:out value="${msg}" escapeXml="true"/>
<hr/>
<c:if test="${age>=18}">
    成年人
</c:if>
<c:if test="${age<18}">
    未成年人
</c:if>
<hr color="red" size="40"/>
<c:choose>
    <c:when test="${age>=60}">
        老年人
    </c:when>
    <c:when test="${age>=18}">
        年青人
    </c:when>
    <c:when test="${age>14}">
        少年
    </c:when>
    <c:otherwise>
        儿童
    </c:otherwise>
</c:choose>
<hr/>
<ul>
    <c:forEach items="${list}" var="d">
        <li>${d}</li>
    </c:forEach>
</ul>
<hr/>
<c:forEach items="${m}" var="o">
    <p>${o} =====${o.key}===${o.value}</p>
</c:forEach>
<h2>${today}</h2>
<h1><fmt:formatDate value="${today}" pattern="yyyy-MM-dd H:m"/></h1>
<hr/>
<h1>输出 1--50</h1>
<c:forEach begin="1" end="50" var="i" >
    ${i} &emsp;
</c:forEach>
</body>
</html>
